// 文章相关接口
import request from '@/utils/request'
// 获取文章分类
export const artGetChannelService = () => {
    return request.get('/my/cate/list')
}
// 添加文章分类
export const artAddChannelService = (data) => {
    return request.post('/my/cate/add', data)
}
// 编辑文章分类
export const artEditChannelService = (data) => {
    return request.put('/my/cate/info', data)
}
// 删除文章分类
export const artDelChannelService = (id) => {
    return request.delete('/my/cate/del', {
        // 解构
        params: { id }
    })
}

// 文章管理相关接口
// 获取文章列表
export const artGetListService = (params) => {
    return request.get('/my/article/list', {
        params
    })
}

// 发布文章
export const artPublishService = (data) => {
    return request.post('/my/article/add', data)
}

// 获取文章详情
export const artArticleInfo = (id) => {
    return request.get('/my/article/info', {
        params: { id }
    })
}

// 更新文章详情
export const artUpdateArticle = (data) => {
    return request.put('/my/article/info', data)
}

// 删除文章
export const artRemoveArticle = (id) => {
    return request.delete('/my/article/info', {
        params: { id }
    })
}